﻿Imports DAO
Imports DTO
Public Class ucDanhSachKhamBenh

    Private Sub GroupBox1_Enter(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles GroupBox1.Enter

    End Sub

    Private Sub btntimkiem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btntimkiem.Click
        Dim BN As New DanhSachKhamBenh_DTO()
        ' ma benh nhan
        If (cbmabenhnhan.Checked) Then
            Try
                BN.MaBenhNhan = Long.Parse(txtmabenhnhan.Text)
            Catch ex As Exception
                MessageBox.Show("Ma benh nhan khong hop le")
                Return
            End Try
        End If
        ' gioi tinh
        If (cbgioitinh.Checked) Then
            Try
                BN.GioiTinh = cbbgioitinh.SelectedItem.ToString()
            Catch ex As Exception
                MessageBox.Show("loi gioi tinh")
                Return
            End Try
        End If
        'ngay kham
        If (cbngaykham.Checked) Then
            Try
                BN.NgayKham = dtpngaykham.Value
            Catch ex As Exception
                MessageBox.Show("loi~ ngay kham")
                Return
            End Try
        End If
        'ho ten
        Try
            BN.HoTen = txthoten.Text
        Catch ex As Exception
            MessageBox.Show("Ho Ten Khong Hop le")
            Return
        End Try

    End Sub

    Private Sub ucDanhSachKhamBenh_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        cbbgioitinh.Items.Add("Nam")
        cbbgioitinh.Items.Add("Nữ")
    End Sub
End Class
